import user from "../model/user.js"

//添加用户
export async function addUser(userInfo){
    await user.create(userInfo)
}

//根据电话号码查询用户信息
export async function selectUserByMobile(mobile){
    const userInfo = await user.findAll({
        where: {
            mobile:mobile
        }
    })

    return userInfo;
}

//根据用户名查询用户信息
export async function selectUserByName(name){
    const userInfo = await user.findAll({
        where: {
            name: name
        }
    })

    return userInfo;
}

//根据ID获取用户信息
export async function selectUserById(id){
    const userInfo = await user.findAll({
        where:{
            id:id
        }
    })

    return userInfo
}
